package com.telcordia.cvas.login;

import static org.easymock.EasyMock.*;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class LoginServiceTest {
	private static final String PASSWORD = "password";
	private static final String ACCOUNT = "account";

	@Test
	public void loggingInSuccessfully() {
		Account account = createMock(Account.class);
		AccountRepository repo = createMock(AccountRepository.class);
		expect(repo.findAccountNamed(isA(String.class))).andReturn(account);
		
		replay(account);
		replay(repo);
		
		LoginService service = new LoginService(repo);
		
		assertTrue(service.validateLogin(ACCOUNT, PASSWORD));
	}
}
